#ifndef __USER_H__
#define __USER_H__

/*头文件*/
//------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//------------------------------------


/*宏定义*/
//------------------------------------
#define CODE_SIZE 16
#define USER_SIZE 12
#define LOTTERY_SIZE 5
//------------------------------------


/*结构体*/
//------------------------------------
#pragma pack(4)
typedef struct
{
	int balance;  //余额
	char name[USER_SIZE];
	char pwd[CODE_SIZE];
} User;

typedef struct
{
	int id; 
	int issue_version;
	int issue_status;
	int prize_status;
	int prize_gain;
	char name[USER_SIZE];
	char lottery_num[LOTTERY_SIZE];
} xLottery;
#pragma pack()
//------------------------------------


/*全局变量声明*/
//------------------------------------
extern int QIHAO, perPrice_lottery, STATE,PRIZE_POOL;
//------------------------------------


/*使用文件，文件指针*/
//------------------------------------
extern char* user_info;
extern char* lottery_info;
extern char* lottery_man;
extern char* prize_pool;
extern FILE* f_prize_pool, *f_lottery_man;
//------------------------------------

/*函数声明*/
//------------------------------------
void menu(char* user);
void pwdAlter(User* pusers);
void info_user(User* pusers);
void info_lotteries(User* pusers, xLottery* plots);
void cancel_lots(User* pusers, xLottery* plots);
void recharge(User* pusers);
void buy(User* pusers);
void withdraw(User* pusers);
void save_user(User* pusers, FILE* f_user, FILE* ptemp_user,int notDele);
void get_code(char* c) ;
//------------------------------------


#endif
